home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / qbevgfx2.zip / QBEVGFX.DOC < prev    next >
Text File  |  1992-03-21  |  20KB  |  568 lines

  1.  
  2. Shareware Documentation            QB/EVGFX (C)1990 Cornel Huth
  3. with minor changes 21-Mar-92 chh
  4.  
  5. Complete documentation is available with registration.  See the
  6. end of this document for complete ordering information.
  7.  
  8. Shareware, def.  A try-before-you-buy marketing concept.  It
  9. relies on those that benefit from the product to pay for it.  Go
  10. ahead and try before you buy.  If you can't use it, pass it
  11. along, someone else may.  If you can and do use it, pay for it. 
  12. What do you get for your money?  Not only the legal continued use
  13. of the product but you also get personal support from the author. 
  14. Need something changed for a particular need?  Just ask.  Try
  15. that anywhere else.  Just remember, this product is not free, so
  16. if you use it please pay for it.
  17.  
  18.  
  19. OVERVIEW
  20.  
  21. QB/EVGFX is a set of graphic routines for the EGA and VGA
  22. assembled into a linkable LIB file.  All routines have been
  23. written in 8086 assembly and are self-contained.  In other words,
  24. even though QB/EVGFX has been designed for QuickBASIC 4.00+
  25. compilers, QuickBASIC itself is not needed.
  26.  
  27. QB/EVGFX requires an EGA or VGA compatible video card with at
  28. least 256K of RAM.  It can be used in any native EGA and VGA mode
  29. and also extended modes.  All these routines will work on either
  30. an EGA or VGA.
  31.  
  32. Accept the fact that these routines are for programmers. 
  33. Understand that this documentation is for programmers.
  34. If you are not completely familiar with QB, BC, LINK and LIB, do
  35. not fault this documentation.  Consult the appropriate reference
  36. or register this release to receive the 70-plus-page programmer
  37. reference manual.  The manual describes each routine completely
  38. and offers ideas on how it, and QB/EVGFX, can best be used.
  39.  
  40. @@@@@@@@ Version 1.1 is the latest and greatest release of QB/EVGFX @@@@@@@@@@@
  41. @                                                                             @
  42. @ This shareware release you now have is 1.0, the original. Release 1.1       @
  43. @ has a few more routines (like dithered windows), cleaned-up docs, better    @
  44. @ window parameters (x/y-size rather than end-points), more fonts (70+),      @
  45. @ pixel-precision windowed draw routines, and more I can't remember now.      @
  46. @ Release 1.0 was distributed through limited channels nearly 1 1/2 years     @
  47. @ ago. This re-release through PDN (thanks Erik! et. al) should result in a   @
  48. @ greater exposure and that's what shareware is all about. -- Granted, these  @
  49. @ docs in this shareware release won't make you an instant expert, but it sure@
  50. @ should give you a good idea of what this package can do for you. To order   @
  51. @ your copy see the form at the end of this documentation and in !ORDER.FRM.  @
  52. @                                                                             @
  53. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  54.  
  55. ----------------------------------------------------------------
  56. * Some routines require a variable-length string in DGROUP as a 
  57. * parameter.  If you don't have this capability, see the section
  58. * on simulating this data structure.
  59. ----------------------------------------------------------------
  60.  
  61.  
  62. -----------------------
  63. QB/EVGFX COMMAND SUMMARY
  64.  VIDEO CONTROL ROUTINES
  65.  DRAWING ROUTINES
  66.  FONTS
  67.  MISC ROUTINES
  68.  
  69. -------------------------------
  70. VIDEO CONTROL ROUTINES include:
  71.  
  72. EGAVIDEO,VGAVIDEO,COLORVIDEO
  73. SETMODE,SETMODEX,GETMODE
  74. SETPSA,GETPSA
  75. SETPALREG,SETPALETTE
  76. SETSCNBUFF
  77. BLANKSCN
  78. BLINKBIT
  79. WAITVS
  80.  
  81.  
  82. FUNCTION EGAVIDEO%()
  83. EGAVIDEO returns -1 if EGA video is supported, 0 if not.
  84. Eg>IsEGA = EGAVIDEO
  85.  
  86.  
  87. FUNCTION VGAVIDEO%()
  88. VGAVIDEO returns -1 if VGA video is supported, 0 if not.
  89. Eg>IsVGA = VGAVIDEO
  90.  
  91.  
  92. FUNCTION COLORVIDEO%()
  93. COLORVIDEO returns -1 if color video is supported, 0 if not.
  94. Eg>IsColor = COLORVIDEO
  95.  
  96.  
  97. SUB SETMODE(mode%)
  98. SETMODE sets the computer's BIOS video to mode.  
  99. Normal EGA 640x350x16 graphics (QB SCREEN 9) is SETMODE 16.
  100. Normal VGA 640x480x16 graphics (QB SCREEN 12) is SETMODE 18.
  101. Eg>SETMODE &H10
  102.  
  103.  
  104. SUB SETMODEX(regax%,regbx%)
  105. SETMODEX is similar to SETMODEX but allows setting the computer's
  106. BIOS mode to an extended mode.  Most extended modes require only
  107. the AL register, in which case SETMODE can be used.  However,
  108. some video adapter's extended modes need an additional register
  109. to also be set (eg EVEREX).  Consult your adapter manual.
  110. Eg>SETMODEX &H0070,&H0
  111.  
  112.  
  113. FUNCTION GETMODE%()
  114. GETMODE returns the current BIOS video mode.
  115. Eg>VMode = GETMODE
  116.  
  117.  
  118. SUB SETPSA(onoff%)
  119. SETPSA activates/deactivates the palette save area. 
  120. SETPSA 1 activates the BIOS palette save area.  Any future
  121. changes in the palette will be stored there for later recall.
  122. SETPSA 0 deactivates the BIOS palette save area.  If you activate
  123. the PSA in your program you MUST deactivate it before the program
  124. ends.
  125. Eg>SETPSA 1
  126.  
  127.  
  128. SUB GETPSA(pal17$)
  129. GETPSA returns a table of palette values and border color.  The
  130. variable pal17$ is a variable length string in DGROUP. The first
  131. byte of pal17$ returned is the color value for attribute 0,
  132. second byte is attribute 1, and so on.  Byte 17 of pal17$ is the
  133. color border value.  This routine should only be used if there is
  134. an active palette save area (SETPSA 1).
  135. Eg>GETPSA pal17$
  136.  
  137.  
  138. SUB SETPALREG(reg%,colorval%)
  139. SETPALREG sets one of the palette registers.  Attribute 0 is
  140. controlled by register 0, attribute 1 by register 1...up to
  141. register 17 which is the border color.  Colorval is any color
  142. value between 0 and 63.
  143. Eg>SETPALREG 8,&H37
  144.  
  145.  
  146. SUB SETPALETTE(pal17$)
  147. SETPALETTE sets all 16 palette registers and the border with a
  148. single call.  The variable pal17$ is a variable length string in
  149. DGROUP.  The first byte of pal17$ is the color value for
  150. attribute 0, second byte is attribute 1, and so on.  Byte 17 of
  151. pal17$ is the border color value.  
  152. Eg>SETPALETTE pal17$
  153.  
  154.  
  155. SETSCNBUFF(x1%,y1%)
  156. SETSCNBUFF set the logical dimensions of the video display
  157. buffer.  This should be done after every video mode change. 
  158. Standard dimensions are x1%=640, y1%=350 for EGA mode 16,
  159. x1%=640,y1%=480 for VGA mode 18.
  160. Eg>SETMODE &H12
  161. Eg>SETSCNBUFF 640,480
  162.  
  163.  
  164. BLANKSCN(onoff%)
  165. BLANKSCN turns the video system on or off.
  166. BLANKSCN 1 turns the video off.
  167. BLANKSCN 0 turns the video back on.
  168. Eg>BLANKSCN 1
  169.  
  170.  
  171. BLINKBIT(onoff%)
  172. BLINKBIT allows selecting either 16 possible background values or
  173. 8 background values and 8 blinking.  The palette needs to be
  174. adjusted on the EGA before using BLINKBIT 1.
  175. Eg>BLINKBIT 1
  176.  
  177.  
  178. WAITVS(count%)
  179. WAITVS waits for count% vertical sync signals.  In EGA mode 16
  180. and VGA mode 18 a vert sync is at least 1/60th of a second. 
  181. Eg>WAITVS 1
  182.  
  183.  
  184. -------------------------
  185. DRAWING ROUTINES include:
  186.  
  187. READDOT,DRAWDOT
  188. DRAWCH
  189. SETSTEP,GETSTEP
  190. DRAWLN,DRAWLNP,DRAWLNS
  191. DRAWSTR
  192. DRAWELL
  193. FILLSCN,FILLAREA,FILLAREAP,FLUDAREA,FLUDAREAP
  194. DIMBLOCK,GETBLOCK,PUTBLOCK
  195.  
  196.  
  197. The x and y coordinates are screen coordinates with 0,0 at the
  198. upper-left of the screen.  x runs across, y runs down.
  199.  
  200. The value is an attribute value, 0 to 15.  Eg, using a value of 7
  201. would use the color value in attribute register 7.
  202.  
  203. The mode is the method used when updating the pixels.  A mode=0
  204. replaces the pixels, mode=8 ANDs the pixels, mode=16 ORs the
  205. pixels, and mode=24 XORs the pixels.
  206.  
  207.  
  208. FUNCTION READDOT%(x0%,y0%)
  209. READDOT returns the value of the pixel at position x0,y0.
  210. Eg>dot = READDOT(320,175)
  211.  
  212.  
  213. SUB DRAWDOT(mode%,value%,x0%,y0%)
  214. DRAWDOT sets the pixel by mode at position x0,y0 to value.
  215. Eg>DRAWDOT 0,7,320,175
  216.  
  217.  
  218. SUB DRAWCH(mode%,char%,x0%,y0%,fg%,bg%)
  219. DRAWCH draws ASCII char by mode at position x0,y0 in foreground
  220. value fg, background bg.
  221. Eg>DRAWCH 0,65,0,0,7,0
  222.  
  223.  
  224. SUB DRAWLN(mode%,value%,x0%,y0%,x1%,y1%)
  225. DRAWLN draws a line by mode from x0,y0 to x1,y1 in value.
  226. Eg>DRAWLN 0,7,0,0,639,349
  227.  
  228.  
  229. SUB DRAWLNP(mode%,pattern$,x0%,y0%,x1%,y1%)
  230. DRAWLNP draws a line by mode from x0,y0 to x1,y1 using the
  231. pattern pattern$.  The first byte of pattern$ is to be the shift
  232. count, the other bytes are the attribute values to use as the
  233. pattern.  Though not all that useful in DRAWLNP, the shift count
  234. lets you fill with diagonal pattern